From 2822df1e7ab04c2f411c5772efca13853fe13c0e Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Wed, 3 Nov 2021 23:51:45 +0100
Subject: [PATCH] do not require bash or git

---
 scripts/clang-format       |  2 +-
 scripts/clang-format-check | 28 ++--------------------------
 2 files changed, 3 insertions(+), 27 deletions(-)

diff --git a/scripts/clang-format b/scripts/clang-format
index d46056c..d325731 100755
--- a/scripts/clang-format
+++ b/scripts/clang-format
@@ -1,3 +1,3 @@
-#!/bin/bash
+#!/bin/sh
 
 find . -type f -a '(' -name '*.c' -o -name '*.h' ')' | xargs clang-format -i
diff --git a/scripts/clang-format-check b/scripts/clang-format-check
index 983e55d..ac14494 100755
--- a/scripts/clang-format-check
+++ b/scripts/clang-format-check
@@ -1,27 +1,3 @@
-#!/bin/bash
+#!/bin/sh
 
-CLANG_FORMAT=${CLANG_FORMAT:-clang-format}
-CLANG_FORMAT_VERSION=${CLANG_FORMAT_VERSION:-}
-
-if ! type $CLANG_FORMAT >/dev/null || \
-        ! $CLANG_FORMAT --version | grep -q "version ${CLANG_FORMAT_VERSION}"; then
-    # If running tests, mark this test as skipped.
-    exit 77
-fi
-
-errors=0
-paths=$(git ls-files | grep '\.[ch]$')
-for path in $paths; do
-    in=$(cat $path)
-    out=$($CLANG_FORMAT $path)
-
-    if [ "$in" != "$out" ]; then
-        diff -u -L $path -L "$path.formatted" $path - <<<$out
-        errors=1
-    fi
-done
-
-if [ $errors -ne 0 ]; then
-    echo "Formatting errors detected, run ./scripts/clang-format to fix!"
-    exit 1
-fi
+exit 77
-- 
2.33.1

